home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / recent1 / wwwcount2.3src.lha / wwwcount2.3 / cdebug.h < prev    next >
C/C++ Source or Header  |  1996-04-30  |  844b  |  39 lines

  1. #ifndef _CDEBUG_H
  2. #define _CDEBUG_H   1
  3.  
  4. /*
  5. ** A stripped down version of Kevin's (kevin@njit.edu) BUGOUT macros
  6. ** nice job Kev 
  7. ** -- muquit
  8. */
  9.  
  10. #ifdef __Main__
  11.     unsigned int Gdebug;
  12. #else
  13.     extern unsigned int Gdebug;
  14. #endif
  15.  
  16. #ifndef __FILE__
  17. #define __FILE__    "?"
  18. #endif
  19.  
  20.  
  21. #ifndef __LINE__
  22. #define __LINE__    0
  23. #endif
  24.  
  25. #ifdef DEBUG
  26. #define Debug4(fmt,v1,v2,v3,v4)                              \
  27.     if (Gdebug == 1)                                         \
  28.     {char * trick = (fmt);                                   \
  29.     (void) fprintf (stderr,"%s(%d): ", __FILE__,__LINE__);   \
  30.     (void) fprintf (stderr,(trick),(v1),(v2),(v3),(v4));     \
  31.     (void) fprintf (stderr,"\n");}
  32.  
  33. #define Debug2(fmt,v1,v2) Debug4((fmt),(v1),(v2),0,0)
  34. #else
  35. #define Debug4(fmt,v1,v2,v3,v4)
  36. #define Debug2(fmt,v1,v2)
  37. #endif
  38. #endif  /* _CDEBUG_H */
  39.